package vn.aptech.scrumgroup.model;

import java.util.ArrayList;
import java.util.List;

import vn.aptech.scrumgroup.event.ChangeLightListener;
import android.content.Context;
import demo.axitdn.model.Model;

public abstract class AbstractBaseModel extends Model{
	
	public AbstractBaseModel(int backColor, int foreColor){
		this.backColor = backColor;
		this.foreColor = foreColor;
	}
	
	protected List<ChangeLightListener> lightObservers = new ArrayList<ChangeLightListener>();
	
	public abstract boolean isPointOf(float x, float y);//is a point in view area? 
	public abstract void changeColor(int color);
	protected boolean isPressed = false;
	public boolean isBrilliant = false;
	Context activityContext;
	protected int viewIndex;
	
	protected int backColor;
	protected int foreColor;
	
	public boolean getPressState(){
		return isPressed;
	}
	
	public void setPressState(boolean b){
		isPressed = b;
	}
	
	public void setViewIndex(int index){
		this.viewIndex = index;
	}
	
	public int getViewIndex(){
		return viewIndex;
	}
	
	public void setContext(Context context){
		this.activityContext = context;
	}
	
	public Context getContext(){
		return activityContext;
	}
	public int getBackColor() {
		return backColor;
	}
	public void setBackColor(int backColor) {
		this.backColor = backColor;
	}
	public int getForeColor() {
		return foreColor;
	}
	public void setForeColor(int foreColor) {
		this.foreColor = foreColor;
	}
	
	

//	@Override
//	public boolean onPressed(int x, int y) {
//		// TODO Auto-generated method stub
//		return super.onPressed(x, y);
//	}
//	@Override
//	public boolean onReleased(int x, int y) {
//		// TODO Auto-generated method stub
//		if(activityClass != null){
//			Intent intent = new Intent(this.getContext(), activityClass);
//			if(this.getBundle() != null){
//				intent.putExtras(this.getBundle());
//			}
//			this.getContext().startActivity(intent);
//		}
//		return super.onReleased(x, y);
//	}
	
}
